//package com.example.myretrofit2.fragment;
//
//import android.os.Bundle;
//
//import androidx.fragment.app.Fragment;
//import androidx.recyclerview.widget.LinearLayoutManager;
//import androidx.recyclerview.widget.RecyclerView;
//
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//
//import com.example.myretrofit2.Car;
//import com.example.myretrofit2.R;
//import com.example.myretrofit2.adapter.CarAdapter;
//import com.example.myretrofit2.common.MyApplication;
//import com.example.myretrofit2.presenter.CarPresenter;
//import com.example.myretrofit2.presenter.MySubscriber;
//
//import java.util.List;
//
//
//public class Car2Fragment extends Fragment {
//RecyclerView recyclerView;
//    int count;
//    @Override
//    public View onCreateView(LayoutInflater inflater, ViewGroup container,
//                             Bundle savedInstanceState) {
//        // Inflate the layout for this fragment
//        View view = inflater.inflate(R.layout.fragment_car2, container, false);
//        count=0;
//        initView(view);
//        initData();
//        return view;
//    }
//    public void initView(View view){
//        recyclerView = view.findViewById(R.id.goods_list);
//        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(MyApplication.getContext());
//        linearLayoutManager.setOrientation(RecyclerView.VERTICAL);
//        recyclerView.setLayoutManager(linearLayoutManager);
//    }
//    public void initData(){
//        CarPresenter.queryCar(new MySubscriber<List<Car>>(MyApplication.getContext()) {
//            @Override
//            public void onNext(List<Car> cars) {
//                for (Car car:cars){
//                    count+=(car.getNum()*car.getPrice());
//                }
//                CarAdapter carAdapter = new CarAdapter(MyApplication.getContext(),cars,);
//                recyclerView.setAdapter(carAdapter);
//            }
//        });
//    }
//}